home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / PPCRelease / include / powerup / ppcinline / macros.h_old0 < prev    next >
Encoding:
Text File  |  1998-09-16  |  38.9 KB  |  1,073 lines

  1. #ifndef __INLINE_MACROS_H
  2. #define __INLINE_MACROS_H
  3.  
  4. #include <powerup/gcclib/powerup_protos.h>
  5.  
  6. /* Use these macros to calculate cache flush start address and cache flush
  7. length. */
  8. #define __CACHE_START(start) ((void *) ((unsigned long int) (start) & ~31))
  9. #define __CACHE_LENGTH(start,length) ((((length) + (unsigned long int) (start) + 31) & ~31) - ((unsigned long int) (start) & ~31))
  10.  
  11. /*
  12.    General macros for Amiga function calls. Not all the possibilities have
  13.    been created - only the ones which exist in OS 3.1. Third party libraries
  14.    and future versions of AmigaOS will maybe need some new ones...
  15.  
  16.    LPX - functions that take X arguments.
  17.  
  18.    Modifiers (variations are possible):
  19.    NR - no return (void),
  20.    A4, A5 - "a4" or "a5" is used as one of the arguments,
  21.    UB - base will be given explicitly by user (see cia.resource).
  22.    FP - one of the parameters has type "pointer to function".
  23.  
  24.    "bt" arguments are not used - they are provided for backward compatibility
  25.    only.
  26.    Actually..the "bt" parameter is needed because otherwise the macro doesn`t
  27.    work for some reason i don`t know gcc puts an empty argument at the position
  28.    before the argument bn and without the placeholder "bt".
  29.    I think it has something to do with #define *_BASE_NAME
  30.  
  31.    the (cm1==IF_CACHEFLUSHAREA) conditional is optimized away
  32. */
  33.  
  34. #ifndef __INLINE_STUB_H
  35. #include <powerup/ppcinline/stubs.h>
  36. #endif
  37.  
  38. #ifndef POWERUP_PPCLIB_INTERFACE_H
  39. #include <powerup/ppclib/interface.h>
  40. #endif
  41.  
  42. #define LP0(offs, rt, name, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  43. ({                                \
  44.    struct Caos *MyCaos;                        \
  45.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  46.    {                                \
  47.       rt _##name##_re;                        \
  48.       MyCaos->a6        = (ULONG) bn;            \
  49.       MyCaos->M68kCacheMode    =    cm1;            \
  50.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  51.       {                                \
  52.         MyCaos->M68kStart    =    cs1;            \
  53.         MyCaos->M68kLength    =    cl1;            \
  54.       }                                \
  55.       MyCaos->PPCCacheMode    =    cm2;            \
  56.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  57.       {                                \
  58.         MyCaos->PPCStart    =    cs2;            \
  59.         MyCaos->PPCLength    =    cl2;            \
  60.       }                                \
  61.       MyCaos->caos_Un.Offset    =    (-offs);        \
  62.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  63.       _##name##_re;                        \
  64.    }                                \
  65. })
  66.  
  67. #define LP0NR(offs, name, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  68. ({                                \
  69.    struct Caos *MyCaos;                        \
  70.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  71.    {                                \
  72.       MyCaos->a6        = (ULONG) bn;            \
  73.       MyCaos->M68kCacheMode    =    cm1;            \
  74.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  75.       {                                \
  76.         MyCaos->M68kStart    =    cs1;            \
  77.         MyCaos->M68kLength    =    cl1;            \
  78.       }                                \
  79.       MyCaos->PPCCacheMode    =    cm2;            \
  80.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  81.       {                                \
  82.         MyCaos->PPCStart    =    cs2;            \
  83.         MyCaos->PPCLength    =    cl2;            \
  84.       }                                \
  85.       MyCaos->caos_Un.Offset    =    (-offs);        \
  86.       PPCCallOS (MyCaos);                    \
  87.    }                                \
  88. })
  89.  
  90. #define LP1(offs, rt, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  91. ({                                \
  92.    struct Caos *MyCaos;                        \
  93.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  94.    {                                \
  95.       rt _##name##_re;                        \
  96.       MyCaos->##r1        = (ULONG) v1;            \
  97.       MyCaos->a6        = (ULONG) bn;            \
  98.       MyCaos->M68kCacheMode    =    cm1;            \
  99.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  100.       {                                \
  101.         MyCaos->M68kStart    =    cs1;            \
  102.         MyCaos->M68kLength    =    cl1;            \
  103.       }                                \
  104.       MyCaos->PPCCacheMode    =    cm2;            \
  105.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  106.       {                                \
  107.         MyCaos->PPCStart    =    cs2;            \
  108.         MyCaos->PPCLength    =    cl2;            \
  109.       }                                \
  110.       MyCaos->caos_Un.Offset    =    (-offs);        \
  111.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  112.       _##name##_re;                        \
  113.    }                                \
  114. })
  115.  
  116. #define LP1NR(offs, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  117. ({                                \
  118.    struct Caos *MyCaos;                        \
  119.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  120.    {                                \
  121.       MyCaos->##r1        = (ULONG) v1;            \
  122.       MyCaos->a6        = (ULONG) bn;            \
  123.       MyCaos->M68kCacheMode    =    cm1;            \
  124.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  125.       {                                \
  126.         MyCaos->M68kStart    =    cs1;            \
  127.         MyCaos->M68kLength    =    cl1;            \
  128.       }                                \
  129.       MyCaos->PPCCacheMode    =    cm2;            \
  130.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  131.       {                                \
  132.         MyCaos->PPCStart    =    cs2;            \
  133.         MyCaos->PPCLength    =    cl2;            \
  134.       }                                \
  135.       MyCaos->caos_Un.Offset    =    (-offs);        \
  136.       PPCCallOS (MyCaos);                    \
  137.    }                                \
  138. })
  139.  
  140. /* Only graphics.library/AttemptLockLayerRom() */
  141. #define LP1A5(offs, rt, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  142. ({                                \
  143.    struct Caos *MyCaos;                        \
  144.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  145.    {                                \
  146.       rt _##name##_re;                        \
  147.       MyCaos->##r1        = (ULONG) v1;            \
  148.       MyCaos->a6        = (ULONG) bn;            \
  149.       MyCaos->M68kCacheMode    =    cm1;            \
  150.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  151.       {                                \
  152.         MyCaos->M68kStart    =    cs1;            \
  153.         MyCaos->M68kLength    =    cl1;            \
  154.       }                                \
  155.       MyCaos->PPCCacheMode    =    cm2;            \
  156.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  157.       {                                \
  158.         MyCaos->PPCStart    =    cs2;            \
  159.         MyCaos->PPCLength    =    cl2;            \
  160.       }                                \
  161.       MyCaos->caos_Un.Offset    =    (-offs);        \
  162.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  163.       _##name##_re;                        \
  164.    }                                \
  165. })
  166.  
  167. /* Only graphics.library/LockLayerRom() and graphics.library/UnlockLayerRom() */
  168. #define LP1NRA5(offs, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  169. ({                                \
  170.    struct Caos *MyCaos;                        \
  171.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  172.    {                                \
  173.       MyCaos->##r1        = (ULONG) v1;            \
  174.       MyCaos->a6        = (ULONG) bn;            \
  175.       MyCaos->M68kCacheMode    =    cm1;            \
  176.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  177.       {                                \
  178.         MyCaos->M68kStart    =    cs1;            \
  179.         MyCaos->M68kLength    =    cl1;            \
  180.       }                                \
  181.       MyCaos->PPCCacheMode    =    cm2;            \
  182.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  183.       {                                \
  184.         MyCaos->PPCStart    =    cs2;            \
  185.         MyCaos->PPCLength    =    cl2;            \
  186.       }                                \
  187.       MyCaos->caos_Un.Offset    =    (-offs);        \
  188.       PPCCallOS (MyCaos);                    \
  189.    }                                \
  190. })
  191.  
  192. /* Only exec.library/Supervisor() */
  193. #define LP1A5FP(offs, rt, name, t1, v1, r1, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  194. ({                                \
  195.    typedef fpt;                            \
  196.    struct Caos *MyCaos;                        \
  197.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  198.    {                                \
  199.       rt _##name##_re;                        \
  200.       MyCaos->##r1        = (ULONG) v1;            \
  201.       MyCaos->a6        = (ULONG) bn;            \
  202.       MyCaos->M68kCacheMode    =    cm1;            \
  203.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  204.       {                                \
  205.         MyCaos->M68kStart    =    cs1;            \
  206.         MyCaos->M68kLength    =    cl1;            \
  207.       }                                \
  208.       MyCaos->PPCCacheMode    =    cm2;            \
  209.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  210.       {                                \
  211.         MyCaos->PPCStart    =    cs2;            \
  212.         MyCaos->PPCLength    =    cl2;            \
  213.       }                                \
  214.       MyCaos->caos_Un.Offset    =    (-offs);        \
  215.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  216.       _##name##_re;                        \
  217.    }                                \
  218. })
  219.  
  220.  
  221. #define LP2(offs, rt, name, t1, v1, r1, t2, v2, r2, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  222. ({                                \
  223.    struct Caos *MyCaos;                        \
  224.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  225.    {                                \
  226.       rt _##name##_re;                        \
  227.       MyCaos->##r1        = (ULONG) v1;            \
  228.       MyCaos->##r2        = (ULONG) v2;            \
  229.       MyCaos->a6        = (ULONG) bn;            \
  230.       MyCaos->M68kCacheMode    =    cm1;            \
  231.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  232.       {                                \
  233.         MyCaos->M68kStart    =    cs1;            \
  234.         MyCaos->M68kLength    =    cl1;            \
  235.       }                                \
  236.       MyCaos->PPCCacheMode    =    cm2;            \
  237.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  238.       {                                \
  239.         MyCaos->PPCStart    =    cs2;            \
  240.         MyCaos->PPCLength    =    cl2;            \
  241.       }                                \
  242.       MyCaos->caos_Un.Offset    =    (-offs);        \
  243.       _##name##_re = (rt) PPCCallOS (MyCaos);                      \
  244.       _##name##_re;                        \
  245.    }                                \
  246. })
  247.  
  248. #define LP2NR(offs, name, t1, v1, r1, t2, v2, r2, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  249. ({                                \
  250.    struct Caos *MyCaos;                        \
  251.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  252.    {                                \
  253.       MyCaos->##r1        = (ULONG) v1;            \
  254.       MyCaos->##r2        = (ULONG) v2;            \
  255.       MyCaos->a6        = (ULONG) bn;            \
  256.       MyCaos->M68kCacheMode    =    cm1;            \
  257.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  258.       {                                \
  259.         MyCaos->M68kStart    =    cs1;            \
  260.         MyCaos->M68kLength    =    cl1;            \
  261.       }                                \
  262.       MyCaos->PPCCacheMode    =    cm2;            \
  263.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  264.       {                                \
  265.         MyCaos->PPCStart    =    cs2;            \
  266.         MyCaos->PPCLength    =    cl2;            \
  267.       }                                \
  268.       MyCaos->caos_Un.Offset    =    (-offs);        \
  269.       PPCCallOS (MyCaos);                    \
  270.    }                                \
  271. })
  272.  
  273. /* Only cia.resource/AbleICR() and cia.resource/SetICR() */
  274. #define LP2UB(offs, rt, name, t1, v1, r1, t2, v2, r2, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  275. ({                                \
  276.    struct Caos *MyCaos;                        \
  277.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  278.    {                                \
  279.       rt _##name##_re;                        \
  280.       MyCaos->##r1        = (ULONG) v1;            \
  281.       MyCaos->##r2        = (ULONG) v2;            \
  282.       MyCaos->M68kCacheMode    =    cm1;            \
  283.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  284.       {                                \
  285.         MyCaos->M68kStart    =    cs1;            \
  286.         MyCaos->M68kLength    =    cl1;            \
  287.       }                                \
  288.       MyCaos->PPCCacheMode    =    cm2;            \
  289.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  290.       {                                \
  291.         MyCaos->PPCStart    =    cs2;            \
  292.         MyCaos->PPCLength    =    cl2;            \
  293.       }                                \
  294.       MyCaos->caos_Un.Offset    =    (-offs);        \
  295.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  296.       _##name##_re;                        \
  297.    }                                \
  298. })
  299.  
  300. /* Only dos.library/InternalUnLoadSeg() */
  301. #define LP2FP(offs, rt, name, t1, v1, r1, t2, v2, r2, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  302. ({                                \
  303.    typedef fpt;                            \
  304.    struct Caos *MyCaos;                        \
  305.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  306.    {                                \
  307.       rt _##name##_re;                        \
  308.       MyCaos->##r1        = (ULONG) v1;            \
  309.       MyCaos->##r2        = (ULONG) v2;            \
  310.       MyCaos->a6        = (ULONG) bn;            \
  311.       MyCaos->M68kCacheMode    =    cm1;            \
  312.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  313.       {                                \
  314.         MyCaos->M68kStart    =    cs1;            \
  315.         MyCaos->M68kLength    =    cl1;            \
  316.       }                                \
  317.       MyCaos->PPCCacheMode    =    cm2;            \
  318.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  319.       {                                \
  320.         MyCaos->PPCStart    =    cs2;            \
  321.         MyCaos->PPCLength    =    cl2;            \
  322.       }                                \
  323.       MyCaos->caos_Un.Offset    =    (-offs);        \
  324.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  325.       _##name##_re;                        \
  326.    }                                \
  327. })
  328.  
  329. #define LP3(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  330. ({                                \
  331.    struct Caos *MyCaos;                        \
  332.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  333.    {                                \
  334.       rt _##name##_re;                        \
  335.       MyCaos->##r1        = (ULONG) v1;            \
  336.       MyCaos->##r2        = (ULONG) v2;            \
  337.       MyCaos->##r3        = (ULONG) v3;            \
  338.       MyCaos->a6        = (ULONG) bn;            \
  339.       MyCaos->M68kCacheMode    =    cm1;            \
  340.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  341.       {                                \
  342.         MyCaos->M68kStart    =    cs1;            \
  343.         MyCaos->M68kLength    =    cl1;            \
  344.       }                                \
  345.       MyCaos->PPCCacheMode    =    cm2;            \
  346.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  347.       {                                \
  348.         MyCaos->PPCStart    =    cs2;            \
  349.         MyCaos->PPCLength    =    cl2;            \
  350.       }                                \
  351.       MyCaos->caos_Un.Offset    =    (-offs);        \
  352.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  353.       _##name##_re;                        \
  354.    }                                \
  355. })
  356.  
  357. #define LP3NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  358. ({                                \
  359.    struct Caos *MyCaos;                        \
  360.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  361.    {                                \
  362.       MyCaos->##r1        = (ULONG) v1;            \
  363.       MyCaos->##r2        = (ULONG) v2;            \
  364.       MyCaos->##r3        = (ULONG) v3;            \
  365.       MyCaos->a6        = (ULONG) bn;            \
  366.       MyCaos->M68kCacheMode    =    cm1;            \
  367.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  368.       {                                \
  369.         MyCaos->M68kStart    =    cs1;            \
  370.         MyCaos->M68kLength    =    cl1;            \
  371.       }                                \
  372.       MyCaos->PPCCacheMode    =    cm2;            \
  373.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  374.       {                                \
  375.         MyCaos->PPCStart    =    cs2;            \
  376.         MyCaos->PPCLength    =    cl2;            \
  377.       }                                \
  378.       MyCaos->caos_Un.Offset    =    (-offs);        \
  379.       PPCCallOS (MyCaos);                    \
  380.    }                                \
  381. })
  382.  
  383. /* Only cia.resource/AddICRVector() */
  384. #define LP3UB(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  385. ({                                \
  386.    struct Caos *MyCaos;                        \
  387.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  388.    {                                \
  389.       rt _##name##_re;                        \
  390.       MyCaos->##r1        = (ULONG) v1;            \
  391.       MyCaos->##r2        = (ULONG) v2;            \
  392.       MyCaos->##r3        = (ULONG) v3;            \
  393.       MyCaos->M68kCacheMode    =    cm1;            \
  394.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  395.       {                                \
  396.         MyCaos->M68kStart    =    cs1;            \
  397.         MyCaos->M68kLength    =    cl1;            \
  398.       }                                \
  399.       MyCaos->PPCCacheMode    =    cm2;            \
  400.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  401.       {                                \
  402.         MyCaos->PPCStart    =    cs2;            \
  403.         MyCaos->PPCLength    =    cl2;            \
  404.       }                                \
  405.       MyCaos->caos_Un.Offset    =    (-offs);        \
  406.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  407.       _##name##_re;                        \
  408.    }                                \
  409. })
  410.  
  411. /* Only cia.resource/RemICRVector() */
  412. #define LP3NRUB(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  413. ({                                \
  414.    struct Caos *MyCaos;                        \
  415.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  416.    {                                \
  417.       MyCaos->##r1        = (ULONG) v1;            \
  418.       MyCaos->##r2        = (ULONG) v2;            \
  419.       MyCaos->##r3        = (ULONG) v3;            \
  420.       MyCaos->M68kCacheMode    =    cm1;            \
  421.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  422.       {                                \
  423.         MyCaos->M68kStart    =    cs1;            \
  424.         MyCaos->M68kLength    =    cl1;            \
  425.       }                                \
  426.       MyCaos->PPCCacheMode    =    cm2;            \
  427.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  428.       {                                \
  429.         MyCaos->PPCStart    =    cs2;            \
  430.         MyCaos->PPCLength    =    cl2;            \
  431.       }                                \
  432.       MyCaos->caos_Un.Offset    =    (-offs);        \
  433.       PPCCallOS (MyCaos);                    \
  434.    }                                \
  435. })
  436.  
  437. /* Only exec.library/SetFunction() */
  438. #define LP3FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  439. ({                                \
  440.    typedef fpt;                            \
  441.    struct Caos *MyCaos;                        \
  442.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  443.    {                                \
  444.       rt _##name##_re;                        \
  445.       MyCaos->##r1        = (ULONG) v1;            \
  446.       MyCaos->##r2        = (ULONG) v2;            \
  447.       MyCaos->##r3        = (ULONG) v3;            \
  448.       MyCaos->a6        = (ULONG) bn;            \
  449.       MyCaos->M68kCacheMode    =    cm1;            \
  450.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  451.       {                                \
  452.         MyCaos->M68kStart    =    cs1;            \
  453.         MyCaos->M68kLength    =    cl1;            \
  454.       }                                \
  455.       MyCaos->PPCCacheMode    =    cm2;            \
  456.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  457.       {                                \
  458.         MyCaos->PPCStart    =    cs2;            \
  459.         MyCaos->PPCLength    =    cl2;            \
  460.       }                                \
  461.       MyCaos->caos_Un.Offset    =    (-offs);        \
  462.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  463.       _##name##_re;                        \
  464.    }                                \
  465. })
  466.  
  467. /* Only graphics.library/SetCollision() */
  468. #define LP3NRFP(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  469. ({                                \
  470.    typedef fpt;                            \
  471.    struct Caos *MyCaos;                        \
  472.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  473.    {                                \
  474.       MyCaos->##r1        = (ULONG) v1;            \
  475.       MyCaos->##r2        = (ULONG) v2;            \
  476.       MyCaos->##r3        = (ULONG) v3;            \
  477.       MyCaos->a6        = (ULONG) bn;            \
  478.       MyCaos->M68kCacheMode    =    cm1;            \
  479.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  480.       {                                \
  481.         MyCaos->M68kStart    =    cs1;            \
  482.         MyCaos->M68kLength    =    cl1;            \
  483.       }                                \
  484.       MyCaos->PPCCacheMode    =    cm2;            \
  485.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  486.       {                                \
  487.         MyCaos->PPCStart    =    cs2;            \
  488.         MyCaos->PPCLength    =    cl2;            \
  489.       }                                \
  490.       MyCaos->caos_Un.Offset    =    (-offs);        \
  491.       PPCCallOS (MyCaos);                    \
  492.    }                                \
  493. })
  494.  
  495. #define LP4(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  496. ({                                \
  497.    struct Caos *MyCaos;                        \
  498.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  499.    {                                \
  500.       rt _##name##_re;                        \
  501.       MyCaos->##r1        = (ULONG) v1;            \
  502.       MyCaos->##r2        = (ULONG) v2;            \
  503.       MyCaos->##r3        = (ULONG) v3;            \
  504.       MyCaos->##r4        = (ULONG) v4;            \
  505.       MyCaos->a6        = (ULONG) bn;            \
  506.       MyCaos->M68kCacheMode    =    cm1;            \
  507.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  508.       {                                \
  509.         MyCaos->M68kStart    =    cs1;            \
  510.         MyCaos->M68kLength    =    cl1;            \
  511.       }                                \
  512.       MyCaos->PPCCacheMode    =    cm2;            \
  513.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  514.       {                                \
  515.         MyCaos->PPCStart    =    cs2;            \
  516.         MyCaos->PPCLength    =    cl2;            \
  517.       }                                \
  518.       MyCaos->caos_Un.Offset    =    (-offs);        \
  519.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  520.       _##name##_re;                        \
  521.    }                                \
  522. })
  523.  
  524. #define LP4NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  525. ({                                \
  526.    struct Caos *MyCaos;                        \
  527.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  528.    {                                \
  529.       MyCaos->##r1        = (ULONG) v1;            \
  530.       MyCaos->##r2        = (ULONG) v2;            \
  531.       MyCaos->##r3        = (ULONG) v3;            \
  532.       MyCaos->##r4        = (ULONG) v4;            \
  533.       MyCaos->a6        = (ULONG) bn;            \
  534.       MyCaos->M68kCacheMode    =    cm1;            \
  535.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  536.       {                                \
  537.         MyCaos->M68kStart    =    cs1;            \
  538.         MyCaos->M68kLength    =    cl1;            \
  539.       }                                \
  540.       MyCaos->PPCCacheMode    =    cm2;            \
  541.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  542.       {                                \
  543.         MyCaos->PPCStart    =    cs2;            \
  544.         MyCaos->PPCLength    =    cl2;            \
  545.       }                                \
  546.       MyCaos->caos_Un.Offset    =    (-offs);        \
  547.       PPCCallOS (MyCaos);                    \
  548.    }                                \
  549. })
  550.  
  551. /* Only exec.library/RawDoFmt() */
  552. #define LP4FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  553. ({                                \
  554.    typedef fpt;                            \
  555.    struct Caos *MyCaos;                        \
  556.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  557.    {                                \
  558.       rt _##name##_re;                        \
  559.       MyCaos->##r1        = (ULONG) v1;            \
  560.       MyCaos->##r2        = (ULONG) v2;            \
  561.       MyCaos->##r3        = (ULONG) v3;            \
  562.       MyCaos->##r4        = (ULONG) v4;            \
  563.       MyCaos->a6        = (ULONG) bn;            \
  564.       MyCaos->M68kCacheMode    =    cm1;            \
  565.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  566.       {                                \
  567.         MyCaos->M68kStart    =    cs1;            \
  568.         MyCaos->M68kLength    =    cl1;            \
  569.       }                                \
  570.       MyCaos->PPCCacheMode    =    cm2;            \
  571.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  572.       {                                \
  573.         MyCaos->PPCStart    =    cs2;            \
  574.         MyCaos->PPCLength    =    cl2;            \
  575.       }                                \
  576.       MyCaos->caos_Un.Offset    =    (-offs);        \
  577.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  578.       _##name##_re;                        \
  579.    }                                \
  580. })
  581.  
  582. #define LP5(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  583. ({                                \
  584.    struct Caos *MyCaos;                        \
  585.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  586.    {                                \
  587.       rt _##name##_re;                        \
  588.       MyCaos->##r1        = (ULONG) v1;            \
  589.       MyCaos->##r2        = (ULONG) v2;            \
  590.       MyCaos->##r3        = (ULONG) v3;            \
  591.       MyCaos->##r4        = (ULONG) v4;            \
  592.       MyCaos->##r5        = (ULONG) v5;            \
  593.       MyCaos->a6        = (ULONG) bn;            \
  594.       MyCaos->M68kCacheMode    =    cm1;            \
  595.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  596.       {                                \
  597.         MyCaos->M68kStart    =    cs1;            \
  598.         MyCaos->M68kLength    =    cl1;            \
  599.       }                                \
  600.       MyCaos->PPCCacheMode    =    cm2;            \
  601.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  602.       {                                \
  603.         MyCaos->PPCStart    =    cs2;            \
  604.         MyCaos->PPCLength    =    cl2;            \
  605.       }                                \
  606.       MyCaos->caos_Un.Offset    =    (-offs);        \
  607.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  608.       _##name##_re;                        \
  609.    }                                \
  610. })
  611.  
  612. #define LP5NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  613. ({                                \
  614.    struct Caos *MyCaos;                        \
  615.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  616.    {                                \
  617.       MyCaos->##r1        = (ULONG) v1;            \
  618.       MyCaos->##r2        = (ULONG) v2;            \
  619.       MyCaos->##r3        = (ULONG) v3;            \
  620.       MyCaos->##r4        = (ULONG) v4;            \
  621.       MyCaos->##r5        = (ULONG) v5;            \
  622.       MyCaos->a6        = (ULONG) bn;            \
  623.       MyCaos->M68kCacheMode    =    cm1;            \
  624.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  625.       {                                \
  626.         MyCaos->M68kStart    =    cs1;            \
  627.         MyCaos->M68kLength    =    cl1;            \
  628.       }                                \
  629.       MyCaos->PPCCacheMode    =    cm2;            \
  630.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  631.       {                                \
  632.         MyCaos->PPCStart    =    cs2;            \
  633.         MyCaos->PPCLength    =    cl2;            \
  634.       }                                \
  635.       MyCaos->caos_Un.Offset    =    (-offs);        \
  636.       PPCCallOS (MyCaos);                    \
  637.    }                                \
  638. })
  639.  
  640. /* Only exec.library/MakeLibrary() */
  641. #define LP5FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  642. ({                                \
  643.    typedef fpt;                            \
  644.    struct Caos *MyCaos;                        \
  645.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  646.    {                                \
  647.       rt _##name##_re;                        \
  648.       MyCaos->##r1        = (ULONG) v1;            \
  649.       MyCaos->##r2        = (ULONG) v2;            \
  650.       MyCaos->##r3        = (ULONG) v3;            \
  651.       MyCaos->##r4        = (ULONG) v4;            \
  652.       MyCaos->##r5        = (ULONG) v5;            \
  653.       MyCaos->a6        = (ULONG) bn;            \
  654.       MyCaos->M68kCacheMode    =    cm1;            \
  655.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  656.       {                                \
  657.         MyCaos->M68kStart    =    cs1;            \
  658.         MyCaos->M68kLength    =    cl1;            \
  659.       }                                \
  660.       MyCaos->PPCCacheMode    =    cm2;            \
  661.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  662.       {                                \
  663.         MyCaos->PPCStart    =    cs2;            \
  664.         MyCaos->PPCLength    =    cl2;            \
  665.       }                                \
  666.       MyCaos->caos_Un.Offset    =    (-offs);        \
  667.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  668.       _##name##_re;                        \
  669.    }                                \
  670. })
  671.  
  672. #define LP6(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  673. ({                                \
  674.    struct Caos *MyCaos;                        \
  675.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  676.    {                                \
  677.       rt _##name##_re;                        \
  678.       MyCaos->##r1        = (ULONG) v1;            \
  679.       MyCaos->##r2        = (ULONG) v2;            \
  680.       MyCaos->##r3        = (ULONG) v3;            \
  681.       MyCaos->##r4        = (ULONG) v4;            \
  682.       MyCaos->##r5        = (ULONG) v5;            \
  683.       MyCaos->##r6        = (ULONG) v6;            \
  684.       MyCaos->a6        = (ULONG) bn;            \
  685.       MyCaos->M68kCacheMode    =    cm1;            \
  686.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  687.       {                                \
  688.         MyCaos->M68kStart    =    cs1;            \
  689.         MyCaos->M68kLength    =    cl1;            \
  690.       }                                \
  691.       MyCaos->PPCCacheMode    =    cm2;            \
  692.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  693.       {                                \
  694.         MyCaos->PPCStart    =    cs2;            \
  695.         MyCaos->PPCLength    =    cl2;            \
  696.       }                                \
  697.       MyCaos->caos_Un.Offset    =    (-offs);        \
  698.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  699.       _##name##_re;                        \
  700.    }                                \
  701. })
  702.  
  703. #define LP6NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  704. ({                                \
  705.    struct Caos *MyCaos;                        \
  706.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  707.    {                                \
  708.       MyCaos->##r1        = (ULONG) v1;            \
  709.       MyCaos->##r2        = (ULONG) v2;            \
  710.       MyCaos->##r3        = (ULONG) v3;            \
  711.       MyCaos->##r4        = (ULONG) v4;            \
  712.       MyCaos->##r5        = (ULONG) v5;            \
  713.       MyCaos->##r6        = (ULONG) v6;            \
  714.       MyCaos->a6        = (ULONG) bn;            \
  715.       MyCaos->M68kCacheMode    =    cm1;            \
  716.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  717.       {                                \
  718.         MyCaos->M68kStart    =    cs1;            \
  719.         MyCaos->M68kLength    =    cl1;            \
  720.       }                                \
  721.       MyCaos->PPCCacheMode    =    cm2;            \
  722.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  723.       {                                \
  724.         MyCaos->PPCStart    =    cs2;            \
  725.         MyCaos->PPCLength    =    cl2;            \
  726.       }                                \
  727.       MyCaos->caos_Un.Offset    =    (-offs);        \
  728.       PPCCallOS (MyCaos);                    \
  729.    }                                \
  730. })
  731.  
  732. #define LP7(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  733. ({                                \
  734.    struct Caos *MyCaos;                        \
  735.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  736.    {                                \
  737.       rt _##name##_re;                        \
  738.       MyCaos->##r1        = (ULONG) v1;            \
  739.       MyCaos->##r2        = (ULONG) v2;            \
  740.       MyCaos->##r3        = (ULONG) v3;            \
  741.       MyCaos->##r4        = (ULONG) v4;            \
  742.       MyCaos->##r5        = (ULONG) v5;            \
  743.       MyCaos->##r6        = (ULONG) v6;            \
  744.       MyCaos->##r7        = (ULONG) v7;            \
  745.       MyCaos->a6        = (ULONG) bn;            \
  746.       MyCaos->M68kCacheMode    =    cm1;            \
  747.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  748.       {                                \
  749.         MyCaos->M68kStart    =    cs1;            \
  750.         MyCaos->M68kLength    =    cl1;            \
  751.       }                                \
  752.       MyCaos->PPCCacheMode    =    cm2;            \
  753.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  754.       {                                \
  755.         MyCaos->PPCStart    =    cs2;            \
  756.         MyCaos->PPCLength    =    cl2;            \
  757.       }                                \
  758.       MyCaos->caos_Un.Offset    =    (-offs);        \
  759.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  760.       _##name##_re;                        \
  761.    }                                \
  762. })
  763.  
  764. #define LP7NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  765. ({                                \
  766.    struct Caos *MyCaos;                        \
  767.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  768.    {                                \
  769.       MyCaos->##r1        = (ULONG) v1;            \
  770.       MyCaos->##r2        = (ULONG) v2;            \
  771.       MyCaos->##r3        = (ULONG) v3;            \
  772.       MyCaos->##r4        = (ULONG) v4;            \
  773.       MyCaos->##r5        = (ULONG) v5;            \
  774.       MyCaos->##r6        = (ULONG) v6;            \
  775.       MyCaos->##r7        = (ULONG) v7;            \
  776.       MyCaos->a6        = (ULONG) bn;            \
  777.       MyCaos->M68kCacheMode    =    cm1;            \
  778.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  779.       {                                \
  780.         MyCaos->M68kStart    =    cs1;            \
  781.         MyCaos->M68kLength    =    cl1;            \
  782.       }                                \
  783.       MyCaos->PPCCacheMode    =    cm2;            \
  784.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  785.       {                                \
  786.         MyCaos->PPCStart    =    cs2;            \
  787.         MyCaos->PPCLength    =    cl2;            \
  788.       }                                \
  789.       MyCaos->caos_Un.Offset    =    (-offs);        \
  790.       PPCCallOS (MyCaos);                    \
  791.    }                                \
  792. })
  793.  
  794. /* Only workbench.library/AddAppIconA() */
  795. #define LP7A4(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  796. ({                                \
  797.    struct Caos *MyCaos;                        \
  798.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  799.    {                                \
  800.       rt _##name##_re;                        \
  801.       MyCaos->##r1        = (ULONG) v1;            \
  802.       MyCaos->##r2        = (ULONG) v2;            \
  803.       MyCaos->##r3        = (ULONG) v3;            \
  804.       MyCaos->##r4        = (ULONG) v4;            \
  805.       MyCaos->##r5        = (ULONG) v5;            \
  806.       MyCaos->##r6        = (ULONG) v6;            \
  807.       MyCaos->##r7        = (ULONG) v7;            \
  808.       MyCaos->a6        = (ULONG) bn;            \
  809.       MyCaos->M68kCacheMode    =    cm1;            \
  810.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  811.       {                                \
  812.         MyCaos->M68kStart    =    cs1;            \
  813.         MyCaos->M68kLength    =    cl1;            \
  814.       }                                \
  815.       MyCaos->PPCCacheMode    =    cm2;            \
  816.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  817.       {                                \
  818.         MyCaos->PPCStart    =    cs2;            \
  819.         MyCaos->PPCLength    =    cl2;            \
  820.       }                                \
  821.       MyCaos->caos_Un.Offset    =    (-offs);        \
  822.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  823.       _##name##_re;                        \
  824.    }                                \
  825. })
  826.  
  827. /* Would you believe that there really are beasts that need more than 7
  828.    arguments? :-) */
  829.  
  830. /* For example intuition.library/AutoRequest() */
  831. #define LP8(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  832. ({                                \
  833.    struct Caos *MyCaos;                        \
  834.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  835.    {                                \
  836.       rt _##name##_re;                        \
  837.       MyCaos->##r1        = (ULONG) v1;            \
  838.       MyCaos->##r2        = (ULONG) v2;            \
  839.       MyCaos->##r3        = (ULONG) v3;            \
  840.       MyCaos->##r4        = (ULONG) v4;            \
  841.       MyCaos->##r5        = (ULONG) v5;            \
  842.       MyCaos->##r6        = (ULONG) v6;            \
  843.       MyCaos->##r7        = (ULONG) v7;            \
  844.       MyCaos->##r8        = (ULONG) v8;            \
  845.       MyCaos->a6        = (ULONG) bn;            \
  846.       MyCaos->M68kCacheMode    =    cm1;            \
  847.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  848.       {                                \
  849.         MyCaos->M68kStart    =    cs1;            \
  850.         MyCaos->M68kLength    =    cl1;            \
  851.       }                                \
  852.       MyCaos->PPCCacheMode    =    cm2;            \
  853.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  854.       {                                \
  855.         MyCaos->PPCStart    =    cs2;            \
  856.         MyCaos->PPCLength    =    cl2;            \
  857.       }                                \
  858.       MyCaos->caos_Un.Offset    =    (-offs);        \
  859.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  860.       _##name##_re;                        \
  861.    }                                \
  862. })
  863.  
  864. /* For example intuition.library/ModifyProp() */
  865. #define LP8NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  866. ({                                \
  867.    struct Caos *MyCaos;                        \
  868.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  869.    {                                \
  870.       MyCaos->##r1        = (ULONG) v1;            \
  871.       MyCaos->##r2        = (ULONG) v2;            \
  872.       MyCaos->##r3        = (ULONG) v3;            \
  873.       MyCaos->##r4        = (ULONG) v4;            \
  874.       MyCaos->##r5        = (ULONG) v5;            \
  875.       MyCaos->##r6        = (ULONG) v6;            \
  876.       MyCaos->##r7        = (ULONG) v7;            \
  877.       MyCaos->##r8        = (ULONG) v8;            \
  878.       MyCaos->a6        = (ULONG) bn;            \
  879.       MyCaos->M68kCacheMode    =    cm1;            \
  880.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  881.       {                                \
  882.         MyCaos->M68kStart    =    cs1;            \
  883.         MyCaos->M68kLength    =    cl1;            \
  884.       }                                \
  885.       MyCaos->PPCCacheMode    =    cm2;            \
  886.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  887.       {                                \
  888.         MyCaos->PPCStart    =    cs2;            \
  889.         MyCaos->PPCLength    =    cl2;            \
  890.       }                                \
  891.       MyCaos->caos_Un.Offset    =    (-offs);        \
  892.       PPCCallOS (MyCaos);                    \
  893.    }                                \
  894. })
  895.  
  896. /* For example layers.library/CreateUpfrontHookLayer() */
  897. #define LP9(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  898. ({                                \
  899.    struct Caos *MyCaos;                        \
  900.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  901.    {                                \
  902.       rt _##name##_re;                        \
  903.       MyCaos->##r1        = (ULONG) v1;            \
  904.       MyCaos->##r2        = (ULONG) v2;            \
  905.       MyCaos->##r3        = (ULONG) v3;            \
  906.       MyCaos->##r4        = (ULONG) v4;            \
  907.       MyCaos->##r5        = (ULONG) v5;            \
  908.       MyCaos->##r6        = (ULONG) v6;            \
  909.       MyCaos->##r7        = (ULONG) v7;            \
  910.       MyCaos->##r8        = (ULONG) v8;            \
  911.       MyCaos->##r9        = (ULONG) v9;            \
  912.       MyCaos->a6        = (ULONG) bn;            \
  913.       MyCaos->M68kCacheMode    =    cm1;            \
  914.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  915.       {                                \
  916.         MyCaos->M68kStart    =    cs1;            \
  917.         MyCaos->M68kLength    =    cl1;            \
  918.       }                                \
  919.       MyCaos->PPCCacheMode    =    cm2;            \
  920.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  921.       {                                \
  922.         MyCaos->PPCStart    =    cs2;            \
  923.         MyCaos->PPCLength    =    cl2;            \
  924.       }                                \
  925.       MyCaos->caos_Un.Offset    =    (-offs);        \
  926.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  927.       _##name##_re;                        \
  928.    }                                \
  929. })
  930.  
  931. /* For example intuition.library/NewModifyProp() */
  932. #define LP9NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  933. ({                                \
  934.    struct Caos *MyCaos;                        \
  935.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  936.    {                                \
  937.       MyCaos->##r1        = (ULONG) v1;            \
  938.       MyCaos->##r2        = (ULONG) v2;            \
  939.       MyCaos->##r3        = (ULONG) v3;            \
  940.       MyCaos->##r4        = (ULONG) v4;            \
  941.       MyCaos->##r5        = (ULONG) v5;            \
  942.       MyCaos->##r6        = (ULONG) v6;            \
  943.       MyCaos->##r7        = (ULONG) v7;            \
  944.       MyCaos->##r8        = (ULONG) v8;            \
  945.       MyCaos->##r9        = (ULONG) v9;            \
  946.       MyCaos->a6        = (ULONG) bn;            \
  947.       MyCaos->M68kCacheMode    =    cm1;            \
  948.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  949.       {                                \
  950.         MyCaos->M68kStart    =    cs1;            \
  951.         MyCaos->M68kLength    =    cl1;            \
  952.       }                                \
  953.       MyCaos->PPCCacheMode    =    cm2;            \
  954.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  955.       {                                \
  956.         MyCaos->PPCStart    =    cs2;            \
  957.         MyCaos->PPCLength    =    cl2;            \
  958.       }                                \
  959.       MyCaos->caos_Un.Offset    =    (-offs);        \
  960.       PPCCallOS (MyCaos);                    \
  961.    }                                \
  962. })
  963.  
  964. /* LP10 not needed... */
  965. /* Kriton Kyrimis <kyrimis@cti.gr> says CyberGraphics needs the following */
  966. #define LP10(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  967. ({                                \
  968.    struct Caos *MyCaos;                        \
  969.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  970.    {                                \
  971.       rt _##name##_re;                        \
  972.       MyCaos->##r1        = (ULONG) v1;            \
  973.       MyCaos->##r2        = (ULONG) v2;            \
  974.       MyCaos->##r3        = (ULONG) v3;            \
  975.       MyCaos->##r4        = (ULONG) v4;            \
  976.       MyCaos->##r5        = (ULONG) v5;            \
  977.       MyCaos->##r6        = (ULONG) v6;            \
  978.       MyCaos->##r7        = (ULONG) v7;            \
  979.       MyCaos->##r8        = (ULONG) v8;            \
  980.       MyCaos->##r9        = (ULONG) v9;            \
  981.       MyCaos->##r10        = (ULONG) v10;            \
  982.       MyCaos->a6        = (ULONG) bn;            \
  983.       MyCaos->M68kCacheMode    =    cm1;            \
  984.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  985.       {                                \
  986.         MyCaos->M68kStart    =    cs1;            \
  987.         MyCaos->M68kLength    =    cl1;            \
  988.       }                                \
  989.       MyCaos->PPCCacheMode    =    cm2;            \
  990.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  991.       {                                \
  992.         MyCaos->PPCStart    =    cs2;            \
  993.         MyCaos->PPCLength    =    cl2;            \
  994.       }                                \
  995.       MyCaos->caos_Un.Offset    =    (-offs);        \
  996.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  997.       _##name##_re;                        \
  998.    }                                \
  999. })
  1000.  
  1001. /* Only graphics.library/BltMaskBitMapRastPort() */
  1002. #define LP10NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  1003. ({                                \
  1004.    struct Caos *MyCaos;                        \
  1005.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  1006.    {                                \
  1007.       MyCaos->##r1        = (ULONG) v1;            \
  1008.       MyCaos->##r2        = (ULONG) v2;            \
  1009.       MyCaos->##r3        = (ULONG) v3;            \
  1010.       MyCaos->##r4        = (ULONG) v4;            \
  1011.       MyCaos->##r5        = (ULONG) v5;            \
  1012.       MyCaos->##r6        = (ULONG) v6;            \
  1013.       MyCaos->##r7        = (ULONG) v7;            \
  1014.       MyCaos->##r8        = (ULONG) v8;            \
  1015.       MyCaos->##r9        = (ULONG) v9;            \
  1016.       MyCaos->##r10        = (ULONG) v10;            \
  1017.       MyCaos->a6        = (ULONG) bn;            \
  1018.       MyCaos->M68kCacheMode    =    cm1;            \
  1019.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  1020.       {                                \
  1021.         MyCaos->M68kStart    =    cs1;            \
  1022.         MyCaos->M68kLength    =    cl1;            \
  1023.       }                                \
  1024.       MyCaos->PPCCacheMode    =    cm2;            \
  1025.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  1026.       {                                \
  1027.         MyCaos->PPCStart    =    cs2;            \
  1028.         MyCaos->PPCLength    =    cl2;            \
  1029.       }                                \
  1030.       MyCaos->caos_Un.Offset    =    (-offs);        \
  1031.       PPCCallOS (MyCaos);                    \
  1032.    }                                \
  1033. })
  1034.  
  1035. /* Only graphics.library/BltBitMap() */
  1036. #define LP11(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, t11, v11, r11, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  1037. ({                                \
  1038.    struct Caos *MyCaos;                        \
  1039.    MyCaos = (struct Caos *) ((unsigned long int) ((char *) alloca (sizeof (struct Caos) + 31) + 31) & ~31); \
  1040.    {                                \
  1041.       rt _##name##_re;                        \
  1042.       MyCaos->##r1        = (ULONG) v1;            \
  1043.       MyCaos->##r2        = (ULONG) v2;            \
  1044.       MyCaos->##r3        = (ULONG) v3;            \
  1045.       MyCaos->##r4        = (ULONG) v4;            \
  1046.       MyCaos->##r5        = (ULONG) v5;            \
  1047.       MyCaos->##r6        = (ULONG) v6;            \
  1048.       MyCaos->##r7        = (ULONG) v7;            \
  1049.       MyCaos->##r8        = (ULONG) v8;            \
  1050.       MyCaos->##r9        = (ULONG) v9;            \
  1051.       MyCaos->##r10        = (ULONG) v10;            \
  1052.       MyCaos->##r11        = (ULONG) v11;            \
  1053.       MyCaos->a6        = (ULONG) bn;            \
  1054.       MyCaos->M68kCacheMode    =    cm1;            \
  1055.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  1056.       {                                \
  1057.         MyCaos->M68kStart    =    cs1;            \
  1058.         MyCaos->M68kLength    =    cl1;            \
  1059.       }                                \
  1060.       MyCaos->PPCCacheMode    =    cm2;            \
  1061.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  1062.       {                                \
  1063.         MyCaos->PPCStart    =    cs2;            \
  1064.         MyCaos->PPCLength    =    cl2;            \
  1065.       }                                \
  1066.       MyCaos->caos_Un.Offset    =    (-offs);        \
  1067.       _##name##_re = (rt) PPCCallOS (MyCaos);            \
  1068.       _##name##_re;                        \
  1069.    }                                \
  1070. })
  1071.  
  1072. #endif /* __INLINE_MACROS_H */
  1073.